CMAKEFLAGS =
buildpath = .build

all: $(buildpath)/Makefile
	make -C $(buildpath)

$(buildpath)/Makefile: $(buildpath)
	cd $(buildpath) && cmake ..

$(buildpath): CMakeLists.txt
	mkdir -p $(buildpath)
	rm -rf $(buildpath)/*

clean:
	rm -rf $(buildpath) bin proto include/header

.PHONY: all clean

